/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.modelo;

import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;

/**
 *
 * @author egberto
 */
@Entity
public class Departamento {
    
    @Id
    @GeneratedValue
    private Long id;
    
    private String nome;
    
    @OneToMany
    @JoinTable(name="DEP_FUNC",
               joinColumns=@JoinColumn(name="DEP_ID"),
               inverseJoinColumns=@JoinColumn(name="FUNC_ID"))
    private Collection<Funcionarios> funcionarios = new ArrayList<Funcionarios>();

    public Departamento() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Collection<Funcionarios> getFuncionarios() {
        return funcionarios;
    }

    public void setFuncionarios(Collection<Funcionarios> funcionarios) {
        this.funcionarios = funcionarios;
    }

   
    
    
}
